package ratonTalk;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * @author ：Dsi
 * @date ：2021/11/18 19:38
 * Describe ：该类用于制作时间工具类
 */
public class DateUtil {
     public static String dateToString(Date date, String format){
          SimpleDateFormat sdf = new SimpleDateFormat(format);
          return sdf.format(date);
     }
     public static Date stringToDate(String time,String format) throws ParseException {
          SimpleDateFormat sdf=new SimpleDateFormat(format);
          return sdf.parse(time);
     }
}
